//
//  NewButton.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/4/22.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "NewButton.h"
#import "UIViewAdditions.h"

@implementation NewButton


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype) initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.mybutton = [[UIButton alloc] initWithFrame:CGRectMake(10, 0, 30, 30)];
        self.mybutton.layer.masksToBounds = YES;
        self.mybutton.backgroundColor = [UIColor greenColor];
        self.mybutton.layer.cornerRadius = self.mybutton.size.width*2/4;
        [self addSubview:self.mybutton];
        
        self.mytitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.mybutton.bottom + 5, self.frame.size.width, 20)];
        self.mytitleLabel.font = [UIFont fontWithName:nil size:13];
        self.mytitleLabel.backgroundColor = [UIColor magentaColor];
        self.mytitleLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.mytitleLabel];
    }
    return self;
}

@end
